package com.yztc.youbadbad.ui.other.fragment;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.yztc.youbadbad.R;
import com.yztc.youbadbad.ui.other.activity.LogInActivity;
import com.yztc.youbadbad.ui.other.activity.RegisterActivity;
import com.yztc.youbadbad.ui.other.activity.SetActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class MineFragment extends Fragment {


    @BindView(R.id.ivSetting)
    ImageView ivSetting;
    @BindView(R.id.iv_message_lay)
    ImageView ivMessageLay;
    @BindView(R.id.person_tv_login)
    TextView personTvLogin;
    @BindView(R.id.person_tv_register)
    TextView personTvRegister;
    private Context mContext;


    public MineFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_mine, container, false);
        ButterKnife.bind(this, view);
        mContext = getActivity();
        return view;
    }


    @OnClick({R.id.ivSetting, R.id.iv_message_lay, R.id.person_tv_login,R.id.person_tv_register})
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.ivSetting:
                intent.setClass(mContext,SetActivity.class);
                 startActivity(intent);
                break;
            case R.id.iv_message_lay:
                intent.setClass(mContext, LogInActivity.class);
                startActivity(intent);
                break;
            case R.id.person_tv_login:
                intent.setClass(mContext,LogInActivity.class);
                startActivity(intent);
                break;
            case R.id.person_tv_register:
                intent.setClass(mContext,RegisterActivity.class);
                startActivity(intent);
                break;
        }
    }



}
